home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11903 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.iadfw.net!usenet
  2. From: Mark Nelson <markn@airmail.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: RS232 & Strings
  5. Date: Wed, 27 Mar 1996 08:41:47 -0600
  6. Organization: customer of Internet America
  7. Message-ID: <315953AB.47C1@airmail.net>
  8. References: <Pine.SUN.3.91.960326144705.10920A-100000@Ra.MsState.Edu>
  9. NNTP-Posting-Host: dal12-22.ppp.iadfw.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win95; I)
  14.  
  15. > I need to be able to receive a string that is ten
  16. > char. long (starting w/ a + or - and ending with a <CR> ) from an
  17. > external device that is hooked to a PC RS232 port.  I have gotten the
  18. > port initialized, etc. can receive some data from it, but I need to be
  19. > able to receive a string from the device.  Using inport and casting 
  20.  
  21. You are going to need an interrupt driven routine to receive characters.
  22. Trying to read them in using polling is not going to work, because
  23. you are inevitably going to miss some characters.  
  24.  
  25. One solution is to switch to a Windows app, because you can use 
  26. the Windows serial driver.
  27.  
  28. If you don't want to switch, you can use code from an article I have 
  29. posted on my home page.  Follow the links to "Articles."  If you want 
  30. more information, you can check into my book on serial communications.
  31. Info on the book is also on my home page.
  32.  
  33. Mark Nelson
  34. http://web2.airmail.net/markn
  35.